package com.beehoo.dcportal.action;

import java.util.List;

import com.beehoo.dcportal.common.base.BaseAction;
import com.beehoo.dcportal.common.base.BaseException;
import com.beehoo.dcportal.model.MenuBean;
import com.beehoo.dcportal.model.OrganizationBean;
import com.beehoo.dcportal.service.IOrganizationServ;

public class OrganizationAction extends BaseAction{
	private static final long serialVersionUID = -1279748696056563138L;
	private List<OrganizationBean> organizationList;
	private IOrganizationServ organizationServ;
	private List<MenuBean> subMenuLs;

	public List<MenuBean> getSubMenuLs() {
		return subMenuLs;
	}

	public void setSubMenuLs(List<MenuBean> subMenuLs) {
		this.subMenuLs = subMenuLs;
	}

	public List<OrganizationBean> getOrganizationList() {
		return organizationList;
	}

	public void setOrganizationList(List<OrganizationBean> organizationList) {
		this.organizationList = organizationList;
	}

	public IOrganizationServ getOrganizationServ() {
		return organizationServ;
	}

	public void setOrganizationServ(IOrganizationServ organizationServ) {
		this.organizationServ = organizationServ;
	}

	@Override
	public String execute() throws Exception {
		try{
			setClickedMenu(paramMap.get("msgType"));
			
			organizationList = organizationServ.getOrganizationList(paramMap.get("streetId"));
			subMenuLs = getSubMenuList(getCurrMenu().getMenuId());
		}catch (BaseException e) {
			setMessage(e.getMessage());
			return ERROR;
		}

		return SUCCESS;
	}
}
